import 'package:flutter/material.dart';

main() => runApp(MyApp());

// 生成代码快捷键  stl
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: GLHomePage(),
    );
  }
}

class GLHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("基础的widget"),
      ),
      body: GLHomeContent(),
    );
  }
}

class GLHomeContent extends StatefulWidget {
  const GLHomeContent({super.key});

  @override
  State<GLHomeContent> createState() => _GLHomeContentState();
}

class _GLHomeContentState extends State<GLHomeContent> {
  @override
  Widget build(BuildContext context) {
    return Text(
      "《春夜喜雨》 唐·杜甫 \n好雨知时节，当春乃发生。随风潜入夜，润物细无声。",
      textAlign: TextAlign.center,
      maxLines: 4, // 文本行数
      overflow: TextOverflow.ellipsis, // 省略号
      textScaleFactor: 1.5, // 文本缩放
      style: TextStyle(
          fontSize: 24, color: Colors.red, fontWeight: FontWeight.bold),
    );
  }
}
